
<template>
  <div id="main" style="vertical-align:top;">
    <topbar id="topbar"></topbar>
    <div class="container">
      <sidebar id="sidebar" ></sidebar>
      <router-view ></router-view>
    </div>
  </div>
</template>
<script>
import topbar from './components/topbar.vue'
import sidebar from './components/sidebar.vue'
export default{
  name: 'Main',
  components: {
    topbar,
    sidebar
  },
  beforeCreate () {
    if (localStorage.getItem('user') === null) { this.$router.push({path: '/'}) }
  }
}
</script>
<style scoped>
.container {
  display: flex;
  height: 100%;
}
#main{
  height: 100%;
}
router-view {
  flex: 1;
  padding: 20px;
}
#sidebar{
  height: 100%;
}
</style>
